#ifndef FILTER_H
#define FILTER_H
#include <qimage.h>
#include <iostream>
#include <math.h>

using namespace std;
struct image{
    int *R;
    int *G;
    int *B;
};

class Filter
{
public:
    ~Filter();
    virtual QImage convolve(QImage*);
    virtual QImage convolve(QImage*,int mode);
    virtual QImage convolve(QImage*,int mode, double frac);
    struct image convolve_img(QImage*);
    QImage normalize(int*,int*,int*);
    QImage normalize(int*,int*,int*, int mode);
    QImage normalize(int* R,int mode,double frac);
    QImage normalize(int*,int*,int*,int mode, double frac);
    QImage normalize(QImage*);

    void fft(double *real, double *imag, int size, int dir);
    void fft2D(int **re, int** im,int width,int height,int dir);
    void fft2D(double **re, double** im,int width,int height,int dir);
    QImage convolveFFT(QImage*);

    void setKernel(double* kernel,int rows,int cols);
    void setKernel(double* kernel, int rows, int cols, double divisor);

protected:
  int* convolve(int *);
  double *kernel;
  int k_rows,k_cols;
  QImage *in_image;
};

#endif // FILTER_H
